Skip to content

Add extended core mask for up to 256 cores. - #2197

Open
Dimi1010 wants to merge 53 commits into
seladb:devfrom
Dimi1010:feature/long-core-mask
Open

Dimi1010 wants to merge 53 commits into
seladb:devfrom
Dimi1010:feature/long-core-mask

Conversation

@Dimi1010

@Dimi1010 Dimi1010 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds infrastructure for extended core mask that allows addressing up to 256 machine cores.
Part of #1717

Proposal

Current server grade processors frequently exceed 32 cores. The current core mask implementation cannot address these cores as it is limited to 32 bits. The PR proposes adding a new mask object LongCoreMask that is based on std::bitmask instead of uint32_t that can accommodate up to 256 machine cores. The maximum of 256 was chosen as it is the highest available count that would not require changing SystemCore::CoreId data type from uint8_t to uint16_t. Further expansion can happen in a future PR.

Changes

  • Added LongCoreMask to support larger machine core count.
  • The field SystemCore::Mask has been deprecated to disambiguate between the short and long core masks. The field would also be unsafe for system cores with IDs over 32, as they can't be represented. It has been replaced by SystemCore::getShortCoreMask() which dynamically computes the mask from the current SystemCore::CoreId.
  • Added an overload to createCoreVectorFromCoreMask which uses return value instead of out parameter.
  • Added validation for functions createCoreMaskFromCoreVector and createCoreMaskFromCoreIds. They will now throw std::out_of_range exception if they encounter CoreId >= 32.
  • Fixed documentation comments. Comments without @brief did not have their documentation added as short documentation.

Not planned in this PR

  • Add support for LongCoreMask in PfRingDevice.
  • Add support for LongCoreMask in DpdkDevice.

@Dimi1010 Dimi1010 closed this Jul 30, 2026
@Dimi1010 Dimi1010 reopened this Jul 30, 2026
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.65517% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.92%. Comparing base (bbe7ffe) to head (8b9155b).

Files with missing lines Patch % Lines
Common++/src/SystemUtils.cpp 76.08% 9 Missing and 2 partials ⚠️
Tests/Pcap++Test/Tests/DpdkTests.cpp 50.00% 0 Missing and 3 partials ⚠️
Pcap++/src/DpdkDeviceList.cpp 0.00% 0 Missing and 2 partials ⚠️
Examples/DpdkBridge/main.cpp 0.00% 1 Missing ⚠️
Examples/DpdkExample-FilterTraffic/main.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2197      +/-   ##
==========================================
+ Coverage   82.89%   82.92%   +0.02%     
==========================================
  Files         336      336              
  Lines       61062    61214     +152     
  Branches    12965    12656     -309     
==========================================
+ Hits        50620    50759     +139     
+ Misses       9566     9088     -478     
- Partials      876     1367     +491     
Flag Coverage Δ
23.11.6 7.19% <5.71%> (-0.02%) ⬇️
24.11.5 7.18% <5.71%> (-0.03%) ⬇️
25.11.1 7.19% <5.71%> (+0.01%) ⬆️
alpine320 77.09% <83.82%> (+0.01%) ⬆️
fedora42 76.66% <85.48%> (+0.01%) ⬆️
macos-15 82.48% <91.93%> (+0.02%) ⬆️
macos-26 82.48% <91.93%> (+0.01%) ⬆️
macos-26-intel 82.41% <91.93%> (+0.02%) ⬆️
mingw32 71.69% <75.00%> (-0.01%) ⬇️
mingw64 71.69% <75.55%> (+0.07%) ⬆️
npcap ?
rhel94 76.45% <84.37%> (-0.01%) ⬇️
ubuntu2204 76.50% <84.37%> (+<0.01%) ⬆️
ubuntu2404 76.77% <85.71%> (-0.02%) ⬇️
ubuntu2604 76.75% <85.48%> (+0.04%) ⬆️
ubuntu2604-arm64 76.56% <86.15%> (-0.01%) ⬇️
ubuntu2604-icpx 59.34% <84.28%> (+0.06%) ⬆️
unittest 82.92% <89.65%> (+0.02%) ⬆️
windows-2022 85.91% <90.10%> (+0.12%) ⬆️
windows-2025 85.66% <90.10%> (+0.13%) ⬆️
winpcap 85.95% <90.10%> (+0.21%) ⬆️
xdp 53.64% <0.00%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread .github/workflows/build_and_test.yml
@Dimi1010
Dimi1010 force-pushed the feature/long-core-mask branch from 36e0414 to 5b77d9a Compare September 16, 2026 10:51
@Dimi1010
Dimi1010 marked this pull request as ready for review September 16, 2026 17:54
@Dimi1010
Dimi1010 requested a review from seladb as a code owner September 16, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant